<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var person = {
        name: "zhangsan",
        age: 23,
        eat: function () {
            window.alert("eat");
        }
    }
    window.alert(person.name);
    window.alert(person.age);
    person.eat();
</script>
</body>
</html>